// my/shop/shop.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentTab: 0,
    ani_1: null,
    ani_2: null,
    ani_3: null,
    ani_4: null,
    ani_5: null,
    isFixed: false,
    opacity: 0,
    sacle: 0.2,
  },
  animate(even) {
    var step = {
      duration: 500
    }
    var animation = wx.createAnimation();
    var animation1 = animation.rotate(180).step(step).scale(this.data.sacle).step(step).opacity(this.data.opacity).step(step),
      animation = wx.createAnimation({}),
      animation5 = animation.rotate(180).step(step).opacity(1).step(step)

    if (this.data.isFixed == true) {
      console.log(555)
      this.setData({
        opacity: 1,
        sacle: 20,
      })
      console.log(this.data.ani_5)
    } else {
      console.log(777)
      this.setData({
        opacity: 0,
        scale: 0.2,
        ani_1: animation1,
        ani_2: animation1,
        ani_3: animation1,
        ani_4: animation1,
        ani_5: animation5,
      })
    }
    this.setData({
      opacity: 0,
      scale: 0.2,
      isFixed: !this.data.isFixed
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },
  mapfun: function() {
    wx.navigateTo({
      url: '../../pages/map/map'
    })
  },
  //点击切换
  clickTab: function(e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current,
      })
    }
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})